package cc.persistence;

import cc.model.Entity;

import java.util.List;
import java.util.Optional;

/**
 * @Author firefly
 * @since 2018/11/25
 */
public interface PersistenceService {
    <T extends Entity> List<T> list(Class<T> type) throws PersistenceException;

    <T extends Entity> Optional<T> get(Class<T> type, String id) throws PersistenceException;

    void save(Entity entity) throws PersistenceException;

    <T extends Entity> void del(Class<T> type, String id) throws PersistenceException;
}
